package com.mobileares.midp.widgets.client.panel;

import com.google.gwt.event.dom.client.*;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.ui.FlowPanel;

/**
 * Created by IntelliJ IDEA.
 * User: Tom
 * Date: 2011-3-18
 * Time: 14:53:25
 * To change this template use File | Settings | File Templates.
 */
public class EventFlowPanel extends FlowPanel implements HasClickHandlers, HasAllMouseHandlers {
    /**
     * Adds a {@link com.google.gwt.event.dom.client.ClickEvent} handler.
     *
     * @param handler the click handler
     * @return {@link com.google.gwt.event.shared.HandlerRegistration} used to remove this handler
     */
    public HandlerRegistration addClickHandler(ClickHandler handler) {
        return addDomHandler(handler, ClickEvent.getType());

    }

    /**
     * Adds a {@link com.google.gwt.event.dom.client.MouseUpEvent} handler.
     *
     * @param handler the mouse up handler
     * @return {@link com.google.gwt.event.shared.HandlerRegistration} used to remove this handler
     */
    public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
        return addDomHandler(handler, MouseUpEvent.getType());
    }

    /**
     * Adds a {@link com.google.gwt.event.dom.client.MouseOutEvent} handler.
     *
     * @param handler the mouse out handler
     * @return {@link com.google.gwt.event.shared.HandlerRegistration} used to remove this handler
     */
    public HandlerRegistration addMouseOutHandler(MouseOutHandler handler) {
        return addDomHandler(handler, MouseOutEvent.getType());
    }

    /**
     * Adds a {@link com.google.gwt.event.dom.client.MouseOverEvent} handler.
     *
     * @param handler the mouse over handler
     * @return {@link com.google.gwt.event.shared.HandlerRegistration} used to remove this handler
     */
    public HandlerRegistration addMouseOverHandler(MouseOverHandler handler) {
        return addDomHandler(handler, MouseOverEvent.getType());

    }

    /**
     * Adds a {@link com.google.gwt.event.dom.client.MouseWheelEvent} handler.
     *
     * @param handler the mouse wheel handler
     * @return {@link com.google.gwt.event.shared.HandlerRegistration} used to remove this handler
     */
    public HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler) {
        return addDomHandler(handler, MouseWheelEvent.getType());

    }

    /**
     * Adds a {@link com.google.gwt.event.dom.client.MouseDownEvent} handler.
     *
     * @param handler the mouse down handler
     * @return {@link com.google.gwt.event.shared.HandlerRegistration} used to remove this handler
     */
    public HandlerRegistration addMouseDownHandler(MouseDownHandler handler) {
        return addDomHandler(handler, MouseDownEvent.getType());

    }

    /**
     * Adds a {@link com.google.gwt.event.dom.client.MouseMoveEvent} handler.
     *
     * @param handler the mouse move handler
     * @return {@link com.google.gwt.event.shared.HandlerRegistration} used to remove this handler
     */
    public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) {
        return addDomHandler(handler, MouseMoveEvent.getType());

    }
}
